{% load admin_list admintools_bootstrap i18n %}
{% load url from future %}

<div class="pagination pull-right">

<ul>
  <li>
    {% if show_all_url %}
      <a href="{{ show_all_url }}">
        {% trans "Show all" %} {{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %}
      </a>
    {% else %}
      <a href="#">{{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %}</a>
    {% endif %}
  </li>
</ul>

{% if pagination_required %}
<ul>

{% if curr_page.has_previous %}
  <li class="prev"><a href="{% bootstrap_page_url cl curr_page.previous_page_number %}">&larr; {% trans "Previous" %}</a></li>
{% else %}
  <li class="prev disabled"><a href="#">&larr; {% trans "Previous" %}</a></li>
{% endif %}

{% for i in page_range %}
    {% bootstrap_paginator_number cl i %}
{% endfor %}

{% if curr_page.has_next %}
  <li class="next"><a href="{% bootstrap_page_url cl curr_page.next_page_number %}">{% trans "Next" %} &rarr;</a></li>
{% else %}
  <li class="next disabled"><a href="#">{% trans "Next" %} &rarr;</a></li>
{% endif %}

</ul>
{% endif %}

{% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default btn success" value="{% trans 'Save' %}"/>{% endif %}
</div>
